/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 * \file     OsIf.h                                                                                     *
 * \brief    Semidrive os abstract layer                                                                *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/26     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef OSIF_H
#define OSIF_H

#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
#include "Std_Types.h"
#include "Part.h"
#if !defined(CFG_NOT_USED_AUTOSAR_OS)
#include "Os.h"
#else
uint8 OsIf_GetCoreID(void);
extern uint8 OsIf_GetCpuId(void);
#endif /** #if !defined(CFG_NOT_USED_AUTOSAR_OS) */

#if defined(CFG_MULTI_CORE_SMP)
/*
 * OsIf_GetCoreID
 */
#if !defined(CFG_NOT_USED_AUTOSAR_OS)
    #define Mcal_GetCpuIndex()    GetCoreID()
#else /* CFG_NOT_USED_AUTOSAR_OS */
    /* @implements OsIf_GetCoreID_define */
    #define Mcal_GetCpuIndex()    OsIf_GetCoreID()
#endif /* CFG_NOT_USED_AUTOSAR_OS */
#else
#define Mcal_GetCpuIndex()   0U
#endif /** #if defined(CFG_MULTI_CORE_SMP) */

#ifdef __cplusplus
}
#endif

#endif /** #ifndef OSIF_H */

/* End of file */
